<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>表格</title>
    <link rel="stylesheet" href="/static/style.css">
    <link rel="stylesheet" href="/static/layui/css/layui.css">
</head>
<body>
<!--主内容开始-->
<div class="admin-content">
    <button class="layui-btn" id="add">添加</button>
    <table id="voteList" class="layui-table" lay-filter="vote-list"></table>
</div>
<!--主内容结束-->
<script type="text/html" id="listToolBar">
    <a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="download">
        <i class="layui-icon layui-icon-download-circle"></i>下载二维码
    </a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">
        <i class="layui-icon layui-icon-delete"></i>删除
    </a>
    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="update">
        <i class="layui-icon layui-icon-edit"></i>修改
    </a>
</script>
<script type="text/html" id="voteStatus">
    <a class="layui-btn-xs" lay-event="switch">
        {{#  if(d.isSelfVoted == true || d.isSelfVoted == 1){ }}
        <input type="checkbox" name="isSelfVoted" lay-skin="switch" lay-text="允许|禁止" checked>
        {{#  } else { }}
        <input type="checkbox" name="isSelfVoted" lay-skin="switch" lay-text="允许|禁止">
        {{#  } }}
    </a>
</script>
<script src="/static/layui/layui.js"></script>
<script>
    layui.config({
        base: '/static/lib/'
    }).extend({
        voteList: 'voteList'
    }).use(['voteList', 'jquery', 'layer', 'laytpl', 'form'], function(){
        var $ = layui.$
            ,layer = layui.layer
            ,form = layui.form;

        $('#add').click(function () {
            layer.open({
                type: 2,
                title: '添加投票事件',
                shadeClose: true,
                shade: 0.8,
                area: ['70%', '90%'],
                content: '/vote/add' //iframe的url
            });
        })
    });
</script>
</body>
</html>